//! Common types exposing fields under a more general interface.

use stencil_util::TypeName;

/// General trait for all typedefs.
pub trait Typedef {
    /// Gets the name of the type.
    fn name(&self) -> &TypeName;

    /// Gets the family of the type.
    fn family(&self) -> TypeFamily;
}

/// Describes how a type is represented in the target language.
#[derive(Clone, Debug)]
pub enum TypeFamily {
    /// General purpose type that maps closely onto its native representation.
    General,

    /// View of a type encoded into a buffer.  Usually only has a single "buf"
    /// field.
    Buf,
}
